from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from jobboard.views import *
import os
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

site_media = os.path.join(
	os.path.dirname(__file__), 'site_media'
)

urlpatterns = patterns('',
	(r'^$', main_page),
	
	(r'^login/$', 'django.contrib.auth.views.login'),
	(r'^logout/$', logout_page),
	(r'^password_reset/$', 'django.contrib.auth.views.password_reset'),
	(r'^password_reset/done/$', 'django.contrib.auth.views.password_reset_done'),
	(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm'),
	(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete'),
	(r'^password_change/$', 'django.contrib.auth.views.password_change'),
	(r'^password_change_done/$', 'django.contrib.auth.views.password_change_done'),
	(r'^site_media/(?P<path>.*)$', 'django.views.static.serve',
		{'document_root': site_media}),
	(r'^register/$', register_page),
	(r'^register/success/$', direct_to_template,
		{'template': 'registration/register_success.html'}),

	(r'^user/$', user_settings),
	(r'^user/account/$', user_account),
	(r'^user/profile/$', user_profile),
	(r'^user/profile/privacy/$', user_privacy),
	(r'^user/resume/$', user_resume),
	(r'^user/resume/delete/$', delete_resume),
	(r'^user/delete/$', user_delete),
	(r'^user/create_job/$', create_job),
	(r'^user/edit_job/(\d+)/$', edit_job),
	(r'^user/manage_jobs/$', manage_jobs),
	(r'^user/delete_job/(\d+)/$', delete_job),
	(r'^user/favorite/$', favorite_people),
	(r'^user/add/(\w+)/$', add_fav_people),
	(r'^user/remove/(\w+)/$', remove_fav_people),
	
	(r'^personnel/$', get_personnel),
	(r'^jobs/$', get_jobs),
	(r'^jobs/favorite/$', favorite_jobs),
	(r'^jobs/add/(\d+)/$', add_fav_job),
	(r'^jobs/remove/(\d+)/$', remove_fav_job),

	(r'^profile/(\w+)/$', get_profile),
	(r'^resume/(\w+)/$', get_resume),
)